//
//  DataHandle.h
//  HomeIn
//
//  Created by dllo on 15/11/3.
//  Copyright © 2015年 TZP. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <sqlite3.h>
#import "FirstPageModel.h"

@interface DataHandle : NSObject

@property(nonatomic,assign)BOOL isOn;//登录状态（是否登录）
@property(nonatomic,assign)NSInteger userId;//当前登录的账号

+(instancetype)shareDataBaseHandle;
-(void)openDB;//创建并打开数据库
//创建
-(void)createAllTable;
//插入
-(void)insertJingxuanCellModelTable:(FirstPageModel *)model;
//-(void)insertDanpingCellModelTable:(DanpingModel *)model;
//-(void)insertRemenjixuanCellModelTable:(RemenModel *)model;
//-(void)insertYijiaCellModelTable:(WangyijiajuModel *)model;
//-(void)insertShuwuCellModelTable:(WenxinshuwuModel *)model;
//-(void)insertChuwuCellModelTable:(JiatingchuwuModel *)model;
//查询
-(NSMutableArray *)selectJingxuan;
-(NSMutableArray *)selectDanping;
-(NSMutableArray *)selectRemenjixuan;
-(NSMutableArray *)selectYijia;
-(NSMutableArray *)selectShuwu;
-(NSMutableArray *)selectChuwu;
//删除
-(void)deleteJingxuanTable:(NSString *)content_url;
-(void)deleteDanpingTable:(NSString *)cover_image_url;
-(void)deleteYijiaTable:(NSString *)imgsrc;
-(void)deleteShuwuTable:(NSString *)content_url;
-(void)deleteChuwuTable:(NSString *)content_url;

//删除表
-(void)dorpJingxuanTable;
-(void)dorpDanpingTable;
-(void)dorpYijiaTable;
-(void)dorpShuwuTable;
-(void)dorpChuwuTable;


//关闭数据库
-(void)closeDB;

@end
